package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.domain.Intervention;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author M
 */
public interface InterventionDao {


    @Select("SELECT * FROM t_intervene")
    List<Intervention> findAll();
    @Select("select * from t_intervene where id = #{id}")
    Intervention getById(int id);
    @Update("update t_intervene set name=#{name},keyword=#{keyword},suitable=#{suitable},objectives=#{objectives},status=#{status},remarks=#{remarks} where id=#{id}")
    void update(Intervention intervention);
    @Insert("insert into t_intervene values(null,#{name},#{keyword},#{suitable},#{objectives},#{status},#{remarks})")
    void intervention_Add(Intervention intervention);


    public Page<Intervention> selectByCondition(String queryString);
}
